CPPFLAGS=-O3

KmerHash.o: KmerHash.cc KmerHash.h
	g++ $(CPPFLAGS) -c $<
	
HashTable.o: HashTable.cc HashTable.h
	g++ $(CPPFLAGS) -c $<
	
SeedTree.o: SeedTree.cc SeedTree.h
	g++ $(CPPFLAGS) -c $<
	
RefDB.o: RefDB.cc RefDB.h
	g++ $(CPPFLAGS) -c $<
	
HashTableMain.o: HashTableMain.cc HashTable.h
	g++ $(CPPFLAGS) -c $<
	
RepeatAnalyser.o: RepeatAnalyser.cc RepeatAnalyser.h
	g++ $(CPPFLAGS) -c $<

RepeatAnalyserMain.o: RepeatAnalyserMain.cc
	g++ $(CPPFLAGS) -c $<
	
SeedTreeMain.o: SeedTreeMain.cc
	g++ $(CPPFLAGS) -c $<

AlignerAccuracyMain.o : AlignerAccuracyMain.cc
	g++ $(CPPFLAGS) -c $<
	
KmerHashMain.o : KmerHashMain.cc
	g++ $(CPPFLAGS) -c $<
	
AlignerAccuracy.o : AlignerAccuracy.cc AlignerAccuracy.h
	g++ $(CPPFLAGS) -c $<

edit_distance.o : edit_distance.cc edit_distance.h
	g++ $(CPPFLAGS) -c $<
	
commonEdit.o :	commonEdit.cc commonEdit.h
	g++ $(CPPFLAGS) -c $<
	
RepeatAnalyser: RepeatAnalyserMain.o RepeatAnalyser.o HashTable.o KmerHash.o RefDB.o
	g++ $(CPPFLAGS) -o $@ $^
	
HashTable: HashTableMain.o HashTable.o KmerHash.o RefDB.o
	g++ $(CPPFLAGS) -o $@ $^
	
SeedTree: SeedTreeMain.o SeedTree.o HashTable.o KmerHash.o RefDB.o
	g++ $(CPPFLAGS) -o $@ $^

AlignerAccuracy : AlignerAccuracyMain.o AlignerAccuracy.o RefDB.o edit_distance.o commonEdit.o	
	g++ $(CPPFLAGS) -o $@ $^
	
getHash: KmerHashMain.o KmerHash.o
	g++ $(CPPFLAGS) -o $@ $^
	
getReference: getReference.cc RefDB.o
	g++ $(CPPFLAGS) -o $@ $^
	
readGenerator: readGenerator.cc RefDB.o
	g++ $(CPPFLAGS) -o $@ $^
	
mapSimulator: mapSimulator.cc SeedTree.o HashTable.o RefDB.o KmerHash.o LongKmerHash.o LongHashTable.o
	g++ $(CPPFLAGS) -o $@ $^
	
LongKmerHash.o: LongKmerHash.cc LongKmerHash.h
	g++ $(CPPFLAGS) -c $<
	
LongHashTable.o: LongHashTable.cc LongHashTable.h
	g++ $(CPPFLAGS) -c $<

LongHashTable: LongHashTableMain.cc LongHashTable.o RefDB.o LongKmerHash.o
	g++ $(CPPFLAGS) -o $@ $^
	
all: HashTable RepeatAnalyser SeedTree getHash getReference readGenerator mapSimulator LongHashTable

.PHONY: clean copy

clean:
	rm *.o HashTable SeedTree RepeatAnalyser getHash getReference readGenerator mapSimulator LongHashTable
	
copy: run*.py HashTable RepeatAnalyser SeedTree getHash getReference readGenerator mapSimulator LongHashTable
	cp $^ ~/data/hashtable/
